<%@ page import="com.bdqn.pojo.Newtable" %>
<%@ page import="com.bdqn.dao.NewDao" %>
<%@ page import="com.bdqn.pojo.NewType" %>
<%@ page import="com.bdqn.dao.NewTypeDao" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2023/8/22
  Time: 16:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

    <title>Title</title>
    <style>
        table{
            border: 1px solid red;
            margin: 0px auto;
            border-collapse: collapse;
            width: 800px;
            font-size: 30px;
            text-align: center;
            color:blue;

        }
        td{
            border: 1px solid red;
        }
        .a
        {
           width: 200px;
            height: 40px;
            font-size: 30px;
        }

    </style>
</head>
<body>
<% String id=request.getParameter("id");
    Newtable table= NewDao.GetObj(id);

 List<NewType> list= NewTypeDao.getlist();
%>

<jsp:include page="Top.jsp"></jsp:include>

<form action="/Web1/NewUpdate" method="post">
    <input type="hidden" name="id" value="<%=id %>">
    <table>
        <tr>
            <td>姓名</td>
            <td><input class="a" name="nn" type="text" value="<%=table.getTitle() %>"></td>
        </tr>
        <tr>
            <td>新闻类型：</td>
            <td>
                <select name="s1" class="a" id="s1">
                    <% for(NewType obj:list){
                        if(obj.getId()==table.getNtype()){%>

                    <option selected value="<%=obj.getId() %>"><%=obj.getName() %></option>

                    <%}else{ %>
                    <option value="<%=obj.getId() %>"><%=obj.getName() %></option>
                    <%}}%>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="修改">
            </td>
        </tr>
    </table>
</form>
<jsp:include page="Bom.jsp"></jsp:include>
</body>
</html>
